<template>
    <div>
        设置模型

        <el-form ref="form" :model="form" label-width="180px">
            <el-form-item label="业态/一般计税土地成本">
                <el-input v-model="form.ybjstucb"></el-input>
            </el-form-item>

            <el-form-item label="计算模式">
                <el-radio-group v-model="form.resource">
                    <el-radio label="单体"></el-radio>
                    <el-radio label="原数据"></el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="土地成本分摊方法">
                <el-radio-group v-model="form.resource1">
                    <el-radio label="占地面积法"></el-radio>
                    <el-radio label="建筑面积法"></el-radio>
                </el-radio-group>
            </el-form-item>

        
            <el-form-item label="已享受普通住宅免税优惠">
                <el-switch v-model="form.delivery"></el-switch>
            </el-form-item>

            <el-form-item label="累计预缴增值税">
                <el-input v-model="form.leiji_yjzzs"></el-input>
            </el-form-item>

            <el-form-item label="累计留抵退税额">
                <el-input v-model="form.leiji_ldts"></el-input>
            </el-form-item>

            <el-form-item label="预计留抵退税额">
                <el-input v-model="form.yuji_ldts"></el-input>
            </el-form-item>

       
            <el-form-item>
                <el-button type="primary" @click="onSubmit">立即创建</el-button>
                <el-button>取消</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
import calculateApi from '@/api/calculate'
export default {
    data() {
        return {
            calculate_id: '',
            form: {
                id: '',
            }
        }
    },
    methods: {
        onSubmit() {
            calculateApi.setCalculate(this.form).then(response => {
                this.$message({
                    message: response.message,
                    type: 'success'
                });
                this.getCalculateInfo();
            })
        },

        getCalculateInfo() {
            calculateApi.getCalculateInfo(this.calculate_id).then(response => {
                this.form = response.data.info;
            })
        }
    },

    created() {
        var query = this.$route.query;
        if (query.id) {
            this.form.id = query.id;
            this.calculate_id = query.id;

        }

        this.getCalculateInfo();

    },
}
</script>

<style></style>